﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Scrum.Net.ViewModels;

namespace Scrum.NetTests
{
    [TestClass]
    public class MainViewModelTest
    {
        private readonly MainViewModel _viewModel;

        public MainViewModelTest()
        {
            _viewModel = new MainViewModel();
        }

        [TestMethod]
        public void NewProjectTest()
        {
            _viewModel.NewProject();

            Assert.AreEqual(_viewModel.Project.Name, "New Project");
        }

        [TestMethod]
        public void NewUserTest()
        {
            _viewModel.NewProject();
            //_viewModel.ProjectViewModel.NewUser();

            Assert.AreEqual(_viewModel.Project.Users.Count, 1);
            Assert.AreEqual(_viewModel.Project.Users[0].Name, "New User");
        }

        [TestMethod]
        public void SaveProjectTest()
        {
            _viewModel.NewProject();
            _viewModel.SaveProject(@"C:\TestProject.scrum");
        }
    }
}
